﻿
using System;
using iss.sg4210.se18.team6s.jass.DAL;

namespace iss.sg4210.se18.team6s.jass.DAL.DataAccess.MSSQL
{
    public abstract class ObjectDAO : IDisposable
    {
        protected Entities jassEntities = null;
        protected ObjectDAO()
        {
            //jassEntities = new Entities();
            //jassEntities.Connection.Open();
            jassEntities = SessionFactory.buildIfNeeded();
        }

        protected void Save()
        {
            jassEntities.SaveChanges();
        }

        public void Dispose()
        {
            SessionFactory.CloseFactory();
        }
    }
}
